package com.iwdm.renovation.ui;

import android.content.Context;
import android.os.Looper;
import android.widget.Toast;
import androidx.fragment.app.Fragment;

import java.util.concurrent.Executor;
import java.util.concurrent.Executors;


public abstract class BaseFragment extends Fragment {
    public Context mContext;
    //线程池
    public final Executor executor = Executors.newSingleThreadExecutor();
    public BaseFragment(Context mContext) {
        this.mContext = mContext;
    }

    public void showToast(String msg) {
        Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();
    }

    public void showToastSync(String msg) {
        Looper.prepare();
        Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();
        Looper.loop();
    }
}
